package com.zhengbing.tj.common;

/**
 * 公共自定义异常
 *
 * @author zhengbing
 * @date 2025-07-07
 */
public class BaseException extends RuntimeException {

    public static final int DEFAULT_ERROR_CODE = 500;

    private int code;
    private String message;

    public BaseException( String message) {
        super(message);
        this.code = DEFAULT_ERROR_CODE;
        this.message = message;
    }

    public BaseException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
} 